<?php

namespace app\index\model;

use think\Db;
use think\Model;
class User extends BaseModel{


    public function userinfo()
    {
        return $this->hasOne('Userinfo');
    }



    public function getuserInfo($id,$filed="*"){
        return $this->alias("a")
            ->join("ysy_user_info b","a.id = b.user_id","LEFT")
            ->join("ysy_level l","a.level_id = l.id","LEFT")
            ->join("ysy_agent d","a.agent_id = d.id","LEFT")
            ->field($filed)
            ->where("a.id",$id)
            ->find()->toArray();
    }


}
?>